<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopSiteLocationWangguiRelationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_site_location_wanggui_relation', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('siteId')->default(0)->comment('关联选址id');
            $table->string('wgNumber', 16)->default('')->comment('关联网规编号');
            $table->unsignedInteger('grade')->default(0)->comment('网规等级');
            $table->unsignedTinyInteger('match')->default(0)->comment('是否匹配');
            $table->unsignedTinyInteger('type')->default(0)->comment('网规类型 0-商场 1-街道 ');
            $table->unsignedInteger('status')->default(0)->comment('状态处理  1-不展示');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '选址与网规的关联';

            $table->index('siteId', 'idx_siteId');
            $table->index('wgNumber', 'idx_wgNumber');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_site_location_wanggui_relation');
    }
}
